package com.csglxt.domain;

import java.math.BigDecimal;

/**
 * 
 * @ClassName: Storage
 * @Description: 库存实体类
 * @author Delver_Si
 * @date 2015-5-28 下午10:38:33
 * 
 */
@SuppressWarnings("serial")
public class Storage implements java.io.Serializable {

    // Fields

    private String id;
    private Goods goods;
    private BigDecimal goodsNumber;

    // Constructors

    /** default constructor */
    public Storage() {
    }

    /** full constructor */
    public Storage(Goods goods, BigDecimal goodsNumber) {
        this.goods = goods;
        this.goodsNumber = goodsNumber;
    }

    // Property accessors

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Goods getGoods() {
        return this.goods;
    }

    public void setGoods(Goods goods) {
        this.goods = goods;
    }

    public BigDecimal getGoodsNumber() {
        return this.goodsNumber;
    }

    public void setGoodsNumber(BigDecimal goodsNumber) {
        this.goodsNumber = goodsNumber;
    }

    public double getZonge() {
        if (goods.getPrice() != null && goodsNumber != null) {
            return goods.getPrice().multiply(goodsNumber).doubleValue();

        }
        return 0.0;
    }

}